﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Pathfinding;

public class EnemyAnimation : MonoBehaviour
{
    public Animator animator;
    public AIBase aIBase;
   void Start()
    {
        //aIBase = GetComponent<AIBase>();
        //animator = GetComponent<Animator>();
        Debug.Log("start");
    }

    // Update is called once per frame
    void LateUpdate()
    {

        animator.SetFloat("Horizental", aIBase.velocity.x);//rb.velocity.x > 0.01 ? 1.0f : -1.0f);
        //Debug.Log("entrance");
        //Debug.Log(rb.velocity.x);
        //Debug.Log(aIBase.velocity);
        animator.SetFloat("Vertical", aIBase.velocity.y);
        animator.SetFloat("Speed", aIBase.velocity.sqrMagnitude);
    }
}
